package com.clear.state.fsm.state;

/**
 * 定义马里奥类，作为状态的上下文
 */
public class Mario {
    private MarioState state;  // 组合抽象状态：即组合马里奥状态

    public Mario() {
        state = new SmallMario(this);
    }

    public void setState(MarioState state) {
        this.state = state;
    }

    public void handleEvent(Event event) {
        state.handleEvent(event);
    }
}